<script type="text/javascript">
$(function(){
	$.get("applicationSingle/getCardInfo",function(data){
		var content="<option value='' selected>请选择</option>";
		var i;
		$(data).each(function(n,item){
			for(i=0;i<item.certificates.length;i++){
				content+="<option value="+item.certificates[i].certificateType+">"
				+item.certificates[i].certificatesName+"</option>"
			}
			$("#agentPapertypeByCancel").html(content);
		});
	},"json");
	 $.post("cancelCard/getCancelInfo",function(json){
		 if(json.statusCode==DWZ.statusCode.error){
				navTabAjaxDone(json)
				return
			}
		$(json).each(function(n,item){
			$("input[name='citizenCardNo']").val(item.cci.citizenCardNo);
			$("input[name='cardPName']").val(item.cci.cardPName);
			$("input[name='customerName']").val(item.cci.customerName);
			$("input[name='paperType']").val(item.cci.paperTypeName);
			$("input[name='paperNo']").val(item.cci.paperNo);

			$("#isReadByCancel").val(item.cci.isRead)
			$("input[name='cardTypeName']").val(item.cci.cardTypeName);
			$("input[name='cardQualityAssurance']").val(item.cci.cardQualityAssurance);
			$("input[name='cancelCardTime']").val(getDate(Date.now()));
			
			if(item.cci.isRead=="1"){//可读时才有余额
				$("input[name='expectedRefundsDate']").val(getDate(Date.now()));
			}else{
				$("input[name='expectedRefundsDate']").val(getDate(item.cci.expectedRefundsDate));
			}
		})
	},"json") 
});

function goShowDetail(){
	var citizenCardNo=$("input[name='citizenCardNo']").val();
	var cardPName=$("input[name='cardPName']").val();
	var options={"width":"500","height":"500","citizenCardNo":citizenCardNo,"cardPName":cardPName};
	$.pdialog.open("cancelCard/goShowDetail","infos", "押金费用详情",options);
	return false;
}
</script>

<div class="pageContent">
	<form id="commitCancelCardInfo" method="post" action="cancelCard/commitCancelCardInfo" class="required-validate" onsubmit="return validateCallback(this,printViewPageAjaxDone);">
		<div class="pageFormContent" layoutH="96">
			<fieldset>
			<legend>个人信息</legend>
			
			<p>
				<label>姓名：</label>
				<input  type="text" class="" size="30"name="customerName" readonly="readonly" />		
			</p>
			<p>
				<label>证件类型：</label>
				<input type="text"   name="paperType" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>证件号码：</label>
				<input name="paperNo" class="" type="text" size="30" readonly="readonly" />
			</p>	
			</fieldset>
			
			<fieldset>
			<legend>原卡信息</legend>
			<p>
				<label>卡产品：</label>
				<input  name="cardPName" type="text" size="30" readonly="readonly"/>
			</p> 
			<p>
				<label>卡类型：</label>
				<input  name="cardTypeName" type="text" size="30" readonly="readonly"/>
			</p>
			<p>
				<label>市民卡号：</label>
				<input name="citizenCardNo"  type="text" size="30" readonly="readonly" />
			</p>
			<p>
				<label>退卡日期：</label>
				<input name="cancelCardTime" type="text" size="30"  readonly="readonly"/>
			</p>
			<p>
				<label>是否可读：</label>
				<select id="isReadByCancel" name="isRead"   >
				<option value="2">不可读</option>
				<option value="1">可读</option>
				</select>
			</p>
			<p>
				<label>注销原因：</label>
				<input name="logoutReason" type="text" size="30" maxlength="30" />
			</p>
			
			<!-- <p>
				<label>电子钱包余额(元)：</label>
				<input name="balance" type="text" size="30"  readonly="readonly"/>
			</p> -->
			<!-- <p>
				<label>退卡服务收费：</label>
				<input name="supplementCardCharge" type="text" size="30" />
			</p> -->
			<p>
				<label>押金明细：</label>
				<a href="#" onclick="goShowDetail();">选择押金明细</a>
			</p>
			<p>
				<label>退款金额(元)：</label>
				<input name="supplementCardCharge" type="text" size="30" maxlength="30"/>
			    <input name="balance" type="hidden">
			    <input name="refundMoney" type="hidden">
			</p>
			<!-- <p>
				<label>退款合计：</label>
				<input name="supplementCardCharge" type="text" size="30" />
			</p> -->
			 <p>
				<label>质保期(月)：</label>
				<input name="cardQualityAssurance" type="text" size="30" readonly="readonly"/>
			</p>
			<!-- <p>
				<label>预计退款日期：</label>
				<input name="expectedRefundsDate" type="text" size="30"  readonly="readonly"/>
			</p> -->
			</fieldset>
			
			<fieldset>
			<legend>代理人信息</legend>
			<p>
				<label>代理人证件类型：</label>
				<select flag="paperCode" id="agentPapertypeByCancel" name="agentPapertype" >
					
				</select>
			</p>
			<p>
				<label>代理人证件号码：</label>
				<input type="text" size="30" name="agentPaperNo" class="validIdentity"/>
			</p>
			<p>
				<label>代理人姓名：</label>
				<input type="text" size="30" name="agentName" class="validName"/>
			</p>
			<p>
				<label>代理人手机号码：</label>
				<input type="text" size="30" name="agentPhone" class="validMobile"/>
			</p>
			<p>
				<label>备注：</label>
				<input name="remark" type="text" size="30" maxlength="30" />
			</p>
			</fieldset>
			
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit" class="valid">提交</button></div></div></li>
				<li>
					<a class="buttonActive" href="cancelCard/queryCancelCard" target="navTab" rel="cancelCard" title="注销"><span>返回</span></a>
				</li>
			</ul>
		</div>
	</form>
</div>
